package com.xuexi.api;

import com.easygo.utils.PageUtils;
import com.xuexi.easygo.pojo.ContentCategory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("easygo-advert-service")
public interface ContentCategoryClient {

    //分页绑定
    @RequestMapping("/contentCategory_page")
     PageUtils<ContentCategory> getcontentCategorys(@RequestParam(defaultValue = "1",required = false,value = "pageIndex") Integer pageIndex,
                                                          @RequestParam(defaultValue = "5",required = false,value = "pageSize") Integer pageSize,
                                                          @RequestParam(defaultValue = "",required = false,value = "name") String name);

    @RequestMapping("contentCategory_add")
    int addContentCategory(@RequestBody ContentCategory category);

    @RequestMapping("contentCategory_getById")
     ContentCategory getById(@RequestParam(value = "id") Integer id);

    @RequestMapping("contentCategory_update")
     int updateContentCategory(@RequestBody ContentCategory category);

    @RequestMapping("contentCategory_delete")
     int deleteContentCategory(@RequestParam(value = "id") Integer id);

    //下拉框绑定
    @RequestMapping("contentCategory_list")
    List<ContentCategory> getContentCategorys();
}
